package com.cyy.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cyy.common.pojo.dto.CommentLikeDto;
import com.cyy.common.pojo.dto.CommentTreeDto;
import com.cyy.common.pojo.vo.api.ApiMessageVo;
import com.cyy.common.pojo.entity.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 评论表 Mapper 接口
 * </p>
 *
 * @author 曹云友
 * @since 2024-04-01
 */
@Mapper
public interface CommentMapper extends BaseMapper<Comment> {


    List<CommentTreeDto> listByType(@Param("sourceType") String sourceType,
                                    @Param("articleId") Long articleId);

    IPage<ApiMessageVo> queryMessagePage(@Param("page") Page<?> page,
                                         @Param("startIndex") Integer startIndex);

    List<CommentLikeDto> queryLikeCount(@Param("messageIds") List<Integer> messageIds);

    List<Integer> queryClickLikeRecord(@Param("messageIds") List<Integer> messageIds,
                                       @Param("userId") Object userId);
}
